home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIURL.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  15KB  |  375 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIURL.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIURL_h__
  6. #define __gen_nsIURL_h__
  7.  
  8.  
  9. #ifndef __gen_nsIURI_h__
  10. #include "nsIURI.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIURL */
  19. #define NS_IURL_IID_STR "d6116970-8034-11d3-9399-00104ba0fd40"
  20.  
  21. #define NS_IURL_IID \
  22.   {0xd6116970, 0x8034, 0x11d3, \
  23.     { 0x93, 0x99, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}
  24.  
  25. /**
  26.  * The nsIURL interface provides convenience methods that further
  27.  * break down the path portion of nsIURI:
  28.  *
  29.  * http://directory/fileBaseName.fileExtension?query
  30.  * http://directory/fileBaseName.fileExtension#ref
  31.  * http://directory/fileBaseName.fileExtension;param
  32.  *       \          \                       /
  33.  *        \          -----------------------
  34.  *         \                   |          /
  35.  *          \               fileName     /
  36.  *           ----------------------------
  37.  *                       |
  38.  *                   filePath
  39.  *
  40.  * @status FROZEN
  41.  */
  42. class NS_NO_VTABLE nsIURL : public nsIURI {
  43.  public: 
  44.  
  45.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IURL_IID)
  46.  
  47.   /*************************************************************************
  48.      * The URL path is broken down into the following principal components:
  49.      */
  50. /**
  51.      * Returns a path including the directory and file portions of a
  52.      * URL.  For example, the filePath of "http://foo/bar.html#baz" is
  53.      * "/foo/bar.html".
  54.      *
  55.      * Some characters may be escaped.
  56.      */
  57.   /* attribute AUTF8String filePath; */
  58.   NS_IMETHOD GetFilePath(nsACString & aFilePath) = 0;
  59.   NS_IMETHOD SetFilePath(const nsACString & aFilePath) = 0;
  60.  
  61.   /**
  62.      * Returns the parameters specified after the ; in the URL. 
  63.      *
  64.      * Some characters may be escaped.
  65.      */
  66.   /* attribute AUTF8String param; */
  67.   NS_IMETHOD GetParam(nsACString & aParam) = 0;
  68.   NS_IMETHOD SetParam(const nsACString & aParam) = 0;
  69.  
  70.   /**
  71.      * Returns the query portion (the part after the "?") of the URL.
  72.      * If there isn't one, an empty string is returned.
  73.      *
  74.      * Some characters may be escaped.
  75.      */
  76.   /* attribute AUTF8String query; */
  77.   NS_IMETHOD GetQuery(nsACString & aQuery) = 0;
  78.   NS_IMETHOD SetQuery(const nsACString & aQuery) = 0;
  79.  
  80.   /**
  81.      * Returns the reference portion (the part after the "#") of the URL.
  82.      * If there isn't one, an empty string is returned.
  83.      *
  84.      * Some characters may be escaped.
  85.      */
  86.   /* attribute AUTF8String ref; */
  87.   NS_IMETHOD GetRef(nsACString & aRef) = 0;
  88.   NS_IMETHOD SetRef(const nsACString & aRef) = 0;
  89.  
  90.   /*************************************************************************
  91.      * The URL filepath is broken down into the following sub-components:
  92.      */
  93. /**
  94.      * Returns the directory portion of a URL. 
  95.      * If the URL denotes a path to a directory and not a file,
  96.      * e.g. http://foo/bar/, then the Directory attribute accesses
  97.      * the complete /foo/bar/ portion, and the FileName is the 
  98.      * empty string. If the trailing slash is omitted, then the
  99.      * Directory is /foo/ and the file is bar (i.e. this is a 
  100.      * syntactic, not a semantic breakdown of the Path).
  101.      * And hence dont rely on this for something to be a definitely 
  102.      * be a file. But you can get just the leading directory portion 
  103.      * for sure.
  104.      *
  105.      * Some characters may be escaped.
  106.      */
  107.   /* attribute AUTF8String directory; */
  108.   NS_IMETHOD GetDirectory(nsACString & aDirectory) = 0;
  109.   NS_IMETHOD SetDirectory(const nsACString & aDirectory) = 0;
  110.  
  111.   /**
  112.      * Returns the file name portion of a URL.
  113.      * If the URL denotes a path to a directory and not a file,
  114.      * e.g. http://foo/bar/, then the Directory attribute accesses
  115.      * the complete /foo/bar/ portion, and the FileName is the 
  116.      * empty string. Note that this is purely based on searching 
  117.      * for the last trailing slash. And hence dont rely on this to 
  118.      * be a definite file. 
  119.      *
  120.      * Some characters may be escaped.
  121.      */
  122.   /* attribute AUTF8String fileName; */
  123.   NS_IMETHOD GetFileName(nsACString & aFileName) = 0;
  124.   NS_IMETHOD SetFileName(const nsACString & aFileName) = 0;
  125.  
  126.   /*************************************************************************
  127.      * The URL filename is broken down even further:
  128.      */
  129. /**
  130.      * Returns the file basename portion of a filename in a url.
  131.      *
  132.      * Some characters may be escaped.
  133.      */
  134.   /* attribute AUTF8String fileBaseName; */
  135.   NS_IMETHOD GetFileBaseName(nsACString & aFileBaseName) = 0;
  136.   NS_IMETHOD SetFileBaseName(const nsACString & aFileBaseName) = 0;
  137.  
  138.   /**
  139.      * Returns the file extension portion of a filename in a url.  If a file
  140.      * extension does not exist, the empty string is returned.
  141.      *
  142.      * Some characters may be escaped.
  143.      */
  144.   /* attribute AUTF8String fileExtension; */
  145.   NS_IMETHOD GetFileExtension(nsACString & aFileExtension) = 0;
  146.   NS_IMETHOD SetFileExtension(const nsACString & aFileExtension) = 0;
  147.  
  148.   /**
  149.      * This method takes a uri and compares the two.  The common uri portion
  150.      * is returned as a string.  The minimum common uri portion is the 
  151.      * protocol, and any of these if present:  login, password, host and port
  152.      * If no commonality is found, "" is returned.  If they are identical, the
  153.      * whole path with file/ref/etc. is returned.  For file uris, it is
  154.      * expected that the common spec would be at least "file:///" since '/' is
  155.      * a shared common root.
  156.      *
  157.      * Examples:
  158.      *    this.spec               aURIToCompare.spec        result
  159.      * 1) http://mozilla.org/     http://www.mozilla.org/   ""
  160.      * 2) http://foo.com/bar/     ftp://foo.com/bar/        ""
  161.      * 3) http://foo.com:8080/    http://foo.com/bar/       ""
  162.      * 4) ftp://user@foo.com/     ftp://user:pw@foo.com/    ""
  163.      * 5) ftp://foo.com/bar/      ftp://foo.com/bar         ftp://foo.com/
  164.      * 6) ftp://foo.com/bar/      ftp://foo.com/bar/b.html  ftp://foo.com/bar/
  165.      * 7) http://foo.com/a.htm#i  http://foo.com/b.htm      http://foo.com/
  166.      * 8) ftp://foo.com/c.htm#i   ftp://foo.com/c.htm       ftp://foo.com/c.htm
  167.      * 9) file:///a/b/c.html      file:///d/e/c.html        file:///
  168.      */
  169.   /* AUTF8String getCommonBaseSpec (in nsIURI aURIToCompare); */
  170.   NS_IMETHOD GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval) = 0;
  171.  
  172.   /**
  173.      * This method takes a uri and returns a substring of this if it can be
  174.      * made relative to the uri passed in.  If no commonality is found, the
  175.      * entire uri spec is returned.  If they are identical, "" is returned.
  176.      * Filename, query, etc are always returned except when uris are identical.
  177.      */
  178.   /* AUTF8String getRelativeSpec (in nsIURI aURIToCompare); */
  179.   NS_IMETHOD GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval) = 0;
  180.  
  181. };
  182.  
  183. /* Use this macro when declaring classes that implement this interface. */
  184. #define NS_DECL_NSIURL \
  185.   NS_IMETHOD GetFilePath(nsACString & aFilePath); \
  186.   NS_IMETHOD SetFilePath(const nsACString & aFilePath); \
  187.   NS_IMETHOD GetParam(nsACString & aParam); \
  188.   NS_IMETHOD SetParam(const nsACString & aParam); \
  189.   NS_IMETHOD GetQuery(nsACString & aQuery); \
  190.   NS_IMETHOD SetQuery(const nsACString & aQuery); \
  191.   NS_IMETHOD GetRef(nsACString & aRef); \
  192.   NS_IMETHOD SetRef(const nsACString & aRef); \
  193.   NS_IMETHOD GetDirectory(nsACString & aDirectory); \
  194.   NS_IMETHOD SetDirectory(const nsACString & aDirectory); \
  195.   NS_IMETHOD GetFileName(nsACString & aFileName); \
  196.   NS_IMETHOD SetFileName(const nsACString & aFileName); \
  197.   NS_IMETHOD GetFileBaseName(nsACString & aFileBaseName); \
  198.   NS_IMETHOD SetFileBaseName(const nsACString & aFileBaseName); \
  199.   NS_IMETHOD GetFileExtension(nsACString & aFileExtension); \
  200.   NS_IMETHOD SetFileExtension(const nsACString & aFileExtension); \
  201.   NS_IMETHOD GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval); \
  202.   NS_IMETHOD GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval); 
  203.  
  204. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  205. #define NS_FORWARD_NSIURL(_to) \
  206.   NS_IMETHOD GetFilePath(nsACString & aFilePath) { return _to GetFilePath(aFilePath); } \
  207.   NS_IMETHOD SetFilePath(const nsACString & aFilePath) { return _to SetFilePath(aFilePath); } \
  208.   NS_IMETHOD GetParam(nsACString & aParam) { return _to GetParam(aParam); } \
  209.   NS_IMETHOD SetParam(const nsACString & aParam) { return _to SetParam(aParam); } \
  210.   NS_IMETHOD GetQuery(nsACString & aQuery) { return _to GetQuery(aQuery); } \
  211.   NS_IMETHOD SetQuery(const nsACString & aQuery) { return _to SetQuery(aQuery); } \
  212.   NS_IMETHOD GetRef(nsACString & aRef) { return _to GetRef(aRef); } \
  213.   NS_IMETHOD SetRef(const nsACString & aRef) { return _to SetRef(aRef); } \
  214.   NS_IMETHOD GetDirectory(nsACString & aDirectory) { return _to GetDirectory(aDirectory); } \
  215.   NS_IMETHOD SetDirectory(const nsACString & aDirectory) { return _to SetDirectory(aDirectory); } \
  216.   NS_IMETHOD GetFileName(nsACString & aFileName) { return _to GetFileName(aFileName); } \
  217.   NS_IMETHOD SetFileName(const nsACString & aFileName) { return _to SetFileName(aFileName); } \
  218.   NS_IMETHOD GetFileBaseName(nsACString & aFileBaseName) { return _to GetFileBaseName(aFileBaseName); } \
  219.   NS_IMETHOD SetFileBaseName(const nsACString & aFileBaseName) { return _to SetFileBaseName(aFileBaseName); } \
  220.   NS_IMETHOD GetFileExtension(nsACString & aFileExtension) { return _to GetFileExtension(aFileExtension); } \
  221.   NS_IMETHOD SetFileExtension(const nsACString & aFileExtension) { return _to SetFileExtension(aFileExtension); } \
  222.   NS_IMETHOD GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval) { return _to GetCommonBaseSpec(aURIToCompare, _retval); } \
  223.   NS_IMETHOD GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval) { return _to GetRelativeSpec(aURIToCompare, _retval); } 
  224.  
  225. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  226. #define NS_FORWARD_SAFE_NSIURL(_to) \
  227.   NS_IMETHOD GetFilePath(nsACString & aFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFilePath(aFilePath); } \
  228.   NS_IMETHOD SetFilePath(const nsACString & aFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFilePath(aFilePath); } \
  229.   NS_IMETHOD GetParam(nsACString & aParam) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParam(aParam); } \
  230.   NS_IMETHOD SetParam(const nsACString & aParam) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetParam(aParam); } \
  231.   NS_IMETHOD GetQuery(nsACString & aQuery) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetQuery(aQuery); } \
  232.   NS_IMETHOD SetQuery(const nsACString & aQuery) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetQuery(aQuery); } \
  233.   NS_IMETHOD GetRef(nsACString & aRef) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRef(aRef); } \
  234.   NS_IMETHOD SetRef(const nsACString & aRef) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRef(aRef); } \
  235.   NS_IMETHOD GetDirectory(nsACString & aDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDirectory(aDirectory); } \
  236.   NS_IMETHOD SetDirectory(const nsACString & aDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDirectory(aDirectory); } \
  237.   NS_IMETHOD GetFileName(nsACString & aFileName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileName(aFileName); } \
  238.   NS_IMETHOD SetFileName(const nsACString & aFileName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFileName(aFileName); } \
  239.   NS_IMETHOD GetFileBaseName(nsACString & aFileBaseName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileBaseName(aFileBaseName); } \
  240.   NS_IMETHOD SetFileBaseName(const nsACString & aFileBaseName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFileBaseName(aFileBaseName); } \
  241.   NS_IMETHOD GetFileExtension(nsACString & aFileExtension) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileExtension(aFileExtension); } \
  242.   NS_IMETHOD SetFileExtension(const nsACString & aFileExtension) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFileExtension(aFileExtension); } \
  243.   NS_IMETHOD GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCommonBaseSpec(aURIToCompare, _retval); } \
  244.   NS_IMETHOD GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRelativeSpec(aURIToCompare, _retval); } 
  245.  
  246. #if 0
  247. /* Use the code below as a template for the implementation class for this interface. */
  248.  
  249. /* Header file */
  250. class nsURL : public nsIURL
  251. {
  252. public:
  253.   NS_DECL_ISUPPORTS
  254.   NS_DECL_NSIURL
  255.  
  256.   nsURL();
  257.  
  258. private:
  259.   ~nsURL();
  260.  
  261. protected:
  262.   /* additional members */
  263. };
  264.  
  265. /* Implementation file */
  266. NS_IMPL_ISUPPORTS1(nsURL, nsIURL)
  267.  
  268. nsURL::nsURL()
  269. {
  270.   /* member initializers and constructor code */
  271. }
  272.  
  273. nsURL::~nsURL()
  274. {
  275.   /* destructor code */
  276. }
  277.  
  278. /* attribute AUTF8String filePath; */
  279. NS_IMETHODIMP nsURL::GetFilePath(nsACString & aFilePath)
  280. {
  281.     return NS_ERROR_NOT_IMPLEMENTED;
  282. }
  283. NS_IMETHODIMP nsURL::SetFilePath(const nsACString & aFilePath)
  284. {
  285.     return NS_ERROR_NOT_IMPLEMENTED;
  286. }
  287.  
  288. /* attribute AUTF8String param; */
  289. NS_IMETHODIMP nsURL::GetParam(nsACString & aParam)
  290. {
  291.     return NS_ERROR_NOT_IMPLEMENTED;
  292. }
  293. NS_IMETHODIMP nsURL::SetParam(const nsACString & aParam)
  294. {
  295.     return NS_ERROR_NOT_IMPLEMENTED;
  296. }
  297.  
  298. /* attribute AUTF8String query; */
  299. NS_IMETHODIMP nsURL::GetQuery(nsACString & aQuery)
  300. {
  301.     return NS_ERROR_NOT_IMPLEMENTED;
  302. }
  303. NS_IMETHODIMP nsURL::SetQuery(const nsACString & aQuery)
  304. {
  305.     return NS_ERROR_NOT_IMPLEMENTED;
  306. }
  307.  
  308. /* attribute AUTF8String ref; */
  309. NS_IMETHODIMP nsURL::GetRef(nsACString & aRef)
  310. {
  311.     return NS_ERROR_NOT_IMPLEMENTED;
  312. }
  313. NS_IMETHODIMP nsURL::SetRef(const nsACString & aRef)
  314. {
  315.     return NS_ERROR_NOT_IMPLEMENTED;
  316. }
  317.  
  318. /* attribute AUTF8String directory; */
  319. NS_IMETHODIMP nsURL::GetDirectory(nsACString & aDirectory)
  320. {
  321.     return NS_ERROR_NOT_IMPLEMENTED;
  322. }
  323. NS_IMETHODIMP nsURL::SetDirectory(const nsACString & aDirectory)
  324. {
  325.     return NS_ERROR_NOT_IMPLEMENTED;
  326. }
  327.  
  328. /* attribute AUTF8String fileName; */
  329. NS_IMETHODIMP nsURL::GetFileName(nsACString & aFileName)
  330. {
  331.     return NS_ERROR_NOT_IMPLEMENTED;
  332. }
  333. NS_IMETHODIMP nsURL::SetFileName(const nsACString & aFileName)
  334. {
  335.     return NS_ERROR_NOT_IMPLEMENTED;
  336. }
  337.  
  338. /* attribute AUTF8String fileBaseName; */
  339. NS_IMETHODIMP nsURL::GetFileBaseName(nsACString & aFileBaseName)
  340. {
  341.     return NS_ERROR_NOT_IMPLEMENTED;
  342. }
  343. NS_IMETHODIMP nsURL::SetFileBaseName(const nsACString & aFileBaseName)
  344. {
  345.     return NS_ERROR_NOT_IMPLEMENTED;
  346. }
  347.  
  348. /* attribute AUTF8String fileExtension; */
  349. NS_IMETHODIMP nsURL::GetFileExtension(nsACString & aFileExtension)
  350. {
  351.     return NS_ERROR_NOT_IMPLEMENTED;
  352. }
  353. NS_IMETHODIMP nsURL::SetFileExtension(const nsACString & aFileExtension)
  354. {
  355.     return NS_ERROR_NOT_IMPLEMENTED;
  356. }
  357.  
  358. /* AUTF8String getCommonBaseSpec (in nsIURI aURIToCompare); */
  359. NS_IMETHODIMP nsURL::GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval)
  360. {
  361.     return NS_ERROR_NOT_IMPLEMENTED;
  362. }
  363.  
  364. /* AUTF8String getRelativeSpec (in nsIURI aURIToCompare); */
  365. NS_IMETHODIMP nsURL::GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval)
  366. {
  367.     return NS_ERROR_NOT_IMPLEMENTED;
  368. }
  369.  
  370. /* End of implementation class template. */
  371. #endif
  372.  
  373.  
  374. #endif /* __gen_nsIURL_h__ */
  375.